<template>
  <div>
    <el-row :gutter="20">
      <el-col :span="8">
        <el-card shadow="hover" class="mgb20">
          <div class="user-info">
            <img src="static/img/img.jpg" class="user-avator" alt>
            <div class="user-info-cont">
              <div class="user-info-name">{{name}}</div>
              <div>{{role}}</div>
            </div>
          </div>
        </el-card>
      </el-col>
      <!-- <el-col :span="16">
        <el-card shadow="hover" style="height:403px;">
          <div slot="header" class="clearfix">
            <span>数据列表</span>
          </div>
          <div class="leftBox box">
            <p class="box-t">用户列表</p>
            <p>
              <span>用户数 :</span>
              <span>1111</span>
            </p>
            <p>
              <span>签到数 :</span>
              <span>1111</span>
            </p>
            <p>
              <span>中奖人数 :</span>
              <span>1111</span>
            </p>
            <p>
              <span>取消资格数 :</span>
              <span>1111</span>
            </p>
            <p>
              <el-button type="primary">取消人员名单</el-button>
              <el-button type="primary">恢复所有资格</el-button>
            </p>
          </div>
          <div class="centerBox box">
            <p class="box-t">部门列表</p>
            <p>
              <span>部门数量 :</span>
              <span>1111</span>
            </p>
            <p class="box-t">奖项列表</p>
          </div>
          <div class="rightBox box">
            <p class="box-t">奖品列表</p>
          </div>
        </el-card>
      </el-col> -->
    </el-row>
  </div>
</template>

<script>
import bus from '../common/bus';
import * as api from '@/api/userApi';
import * as m_types from '@/store/mutation-types';
export default {
  name: 'dashboard',
  data() {
    return {
      name: '',
      dataList: {

      }
    }
  },
  mounted() {
    this.getActivity()
  },
  computed: {
    role() {
      // return this.name === '闪送年会' ? '超级管理员' : '普通用户';
    }
  },
  methods: {
    getActivity() {
      api.getActivity()
        .then((res) => {
          console.log(res);
          window.userName = res.data.info.name;
          this.name = window.userName
        })
    //   $.ajax({
    //   type: 'post',
    //   url: 'http://meeting.tianbeihui.com/index/user/activity.html',
    //   success: function (data) {
    //     console.log(data);
    //   },
    //   error: function (error) {
    //     // reject(error)
    //   }
    // });
    }
  }

}

</script>


<style scoped>
.el-row {
  margin-bottom: 20px;
}

.grid-content {
  display: flex;
  align-items: center;
  height: 100px;
}

.grid-cont-right {
  flex: 1;
  text-align: center;
  font-size: 14px;
  color: #999;
}

.grid-num {
  font-size: 30px;
  font-weight: bold;
}

.grid-con-icon {
  font-size: 50px;
  width: 100px;
  height: 100px;
  text-align: center;
  line-height: 100px;
  color: #fff;
}

.grid-con-1 .grid-con-icon {
  background: rgb(45, 140, 240);
}

.grid-con-1 .grid-num {
  color: rgb(45, 140, 240);
}

.grid-con-2 .grid-con-icon {
  background: rgb(100, 213, 114);
}

.grid-con-2 .grid-num {
  color: rgb(45, 140, 240);
}

.grid-con-3 .grid-con-icon {
  background: rgb(242, 94, 67);
}

.grid-con-3 .grid-num {
  color: rgb(242, 94, 67);
}

.user-info {
  display: flex;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 2px solid #ccc;
  margin-bottom: 20px;
}

.user-avator {
  width: 120px;
  height: 120px;
  border-radius: 50%;
}

.user-info-cont {
  padding-left: 50px;
  flex: 1;
  font-size: 14px;
  color: #999;
}

.user-info-cont div:first-child {
  font-size: 30px;
  color: #222;
}

.user-info-list {
  font-size: 14px;
  color: #999;
  line-height: 25px;
}

.user-info-list span {
  margin-left: 70px;
}

.mgb20 {
  margin-bottom: 20px;
}

.todo-item {
  font-size: 14px;
}

.todo-item-del {
  text-decoration: line-through;
  color: #999;
}

.schart {
  width: 100%;
  height: 300px;
}
.leftBox {
  width: 33.3333%;
  float: left;
  border-right: 1px solid #999;
  box-sizing: border-box;
}
.rightBox {
  width: 33.3333%;
  float: right;
  box-sizing: border-box;
}
.centerBox {
  width: 33.3333%;
  float: left;
  border-right: 1px solid #999;
  box-sizing: border-box;
}
.box p {
  text-align: center;
  margin-bottom: 20px;
  overflow: hidden;
  /* border-bottom: 1px solid #999 */
}
.box p span {
  /* display: inline-block; */
  width: 50%;
  float: left;
}
.box p span:first-child {
  text-align: right;
}
.box .box-t {
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 30px;
  border: 0;
}
</style>
